import request from '../request'
import { upload } from '../request'

const common = {

	uploadAvatarFile:(path)=>{
    return upload({
      url: '/file/upload',
      file: path,
      data: {
        path: 'avatar',
        oss: 'qiniu'
      }
    })
  },
  
  uploadPreview: (path)=>{
    return upload({
      url: '/file/upload',
      file: path,
      data: {
        path: 'preview',
        oss: 'qiniu'
      }
    })
  },
  uploadImage: (path)=>{
    return upload({
      url: '/file/upload',
      file: path,
      data: {
        path: 'image',
        oss: 'qiniu'
      }
    })
  },

	delFile:(path)=>{
		return request({
      url: '/file/delete',
      method: 'post',
      data: {path :path}
    })
  },
  
	getDictData:(type)=>{
		return request({
      url: '/platform/dict/data/type/' + type,
      method: 'get'
    })
  },
  getAreas: ()=>{
    return request({
      url: '/commons/getAreaList',
      method: 'get'
    })
  }
}
export default common